<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
$model->end_time = intval($model->end_time);
$model->start_time = intval($model->start_time);
/* @var $this yii\web\View */
/* @var $model common\models\IcoProject */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="ico-project-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'base_desc')->widget('yii\ueditor\UEditor', []); ?>
    <?= $form->field($model, 'team_desc')->widget('yii\ueditor\UEditor', []); ?>
    <?= $form->field($model, 'white_book')->widget('yii\ueditor\UEditor', []); ?>

    <?= $form->field($model, 'code')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'publish_time')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'cankao_price')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'platform')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'allcount')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'count')->textInput(['maxlength' => true]) ?>

    <div class="col-md-12">
        <label class="form-label">结束时间</label>
        <?= \kartik\date\DatePicker::widget([
            'name' => 'IcoProject[end_time]',
            'value' => $model->end_time>0?date('Y-m-d H:i:s',$model->end_time):'',
            'pluginOptions'=>[
                'format' => 'yyyy-mm-dd'
            ]
        ]);
        ?>
    </div>

    <div class="col-md-12">
        <label class="form-label">开始时间</label>
        <?= \kartik\date\DatePicker::widget([
            'name' => 'IcoProject[start_time]',
            'value' => $model->start_time>0?date('Y-m-d H:i:s',$model->start_time):'',
            'pluginOptions'=>[
                'format' => 'yyyy-mm-dd'
            ]
        ]);
        ?>
    </div>

    <?= $form->field($model, 'level')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'unit')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'coverFile')->fileInput(['maxlength' => true])->label('封面图') ?>

    <?= $form->field($model, 'fee')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'current_count')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'left_count')->textInput(['maxlength' => true]) ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
